package com.wy2cloud.sample.zuulandauthserver.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wy2cloud.sample.zuulandauthserver.entity.AuthorizeUser;
import com.wy2cloud.sample.zuulandauthserver.repository.AuthorizeUserRepository;

@Service
public class AuthorizeUseService {

    @Autowired
    private AuthorizeUserRepository authorizeUserRepository;
    
    public AuthorizeUser findUserById(String id) {
        return authorizeUserRepository.findOne(id);
    }
    
    public AuthorizeUser create(AuthorizeUser user) {
        return authorizeUserRepository.save(user);
    }
    
    public AuthorizeUser findUserByName(String name) {
        return authorizeUserRepository.findUserByName(name);
    }
    public AuthorizeUser findUserByAccount(String account) {
        return authorizeUserRepository.findUserByAccount(account);
    }
}
